<form method="post" action="index.php?modul=articles&action=<?php echo $_GET["subpage"]?>">
	<p class="ui-state-default ui-corner-all ui-helper-clearfix"><?php nadpis() ?></p>
	<input type="hidden" name="id" value='<?php echo $_GET["id"] ?>'>
	<div class="tabulka">
		<table align="center">
			<tr align="center" class="ui-widget-header">
				<td><img src="theme/ikonky/pencil.png" align="absmiddle">  Název</td>
			</tr>
			<tr align="center">
				<td><input type="text" name="name" value="<?php echo $name ?>" class="text ui-widget-content ui-corner-all" style='width: 99%'></td>
			</tr>
			<tr align="center" class="ui-widget-header">
				<td><img src="theme/ikonky/note.png" align="absmiddle"> Poznámka</td>
			</tr>
			<tr align="center">
				<td colspan="2"><textarea name="note" rows="4" class="text ui-widget-content ui-corner-all" style='width: 99%'><?php echo $note ?></textarea></td>
			</tr>
		</table>
	</div>
	<p align="center">
		<?php akce() ?>
	</p>
</form>

<?php

function nadpis()
{
	if($_GET["subpage"] == "add_category")
	{
		echo "<img src='theme/ikonky/folder_add.png' align='absmiddle'> Nová kategorie";
	}
	else if($_GET["subpage"] == "edit_category")
	{
		echo "<img src='theme/ikonky/folder_edit.png' align='absmiddle'> Editace kategorie";
	}
}

function akce()
{
	if($_GET["subpage"] == "add_category")
	{
		echo '
		<button type="submit" class="button">
			<img src="theme/ikonky/folder_go.png" align="absmiddle"> Vytvořit
		</button>';
	}
	else if($_GET["subpage"] == "edit_category")
	{
		echo '
		<button type="submit" class="button">
			<img src="theme/ikonky/folder_edit.png" align="absmiddle"> Uložit změny
		</button>';
	}
}

?>